package cn.com.api.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.api.entity.ApiU_user_label;

import cn.com.api.mapper.ApiU_user_labelMapper;

import cn.com.api.service.ApiU_user_labelService;
import cn.com.api.service.impl.base.U_user_labelServiceImplBase;

/**
 * 
 **/
@Service
public class ApiU_user_labelServiceImpl extends U_user_labelServiceImplBase implements ApiU_user_labelService {
	@Autowired
	private ApiU_user_labelMapper apiU_user_labelMapper;

	private static Logger logger = Logger.getLogger(ApiCommonServiceImpl.class);

	@Override
	public boolean setUserInfoExtend(List<ApiU_user_label> listLabel, String user_id, Integer type) {
		boolean ret = false;
		try {
			apiU_user_labelMapper.delLabelByUid(user_id, type);
			for (ApiU_user_label label : listLabel) {
				// apiU_user_labelMapper.insertU_user_label(label);
				insertU_user_label(label);
			}
			ret = true;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			logger.info("searchMyInterest: " + e.getStackTrace());
		}
		return ret;
	}

	//取用户的专业领域
	@Override
	public List<ApiU_user_label> getUserProfessionArea(Map map)
	{
		return this.apiU_user_labelMapper.findLabelByMap(map);
	}
	
}
